package com.gggd.aopdemo.vo;

import com.gggd.aopdemo.anno.Desensitize;
import com.gggd.aopdemo.enums.DesensitizeType;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @Description
 * @Author srx
 * @date 2021/12/25 13:16
 */
@Data
public class SysUser {

    @NotNull(message = "uid不能为空")
    private Integer uid;

    //脱敏注解，类型为：NAME
    @Desensitize(type = DesensitizeType.NAME)
    private String name;

    //脱敏注解，类型为：PHONE
    @Desensitize(type = DesensitizeType.PHONE)
    @Pattern(regexp = "^[1][3,4,5,6,7,8,9][0-9]{9}$", message = "联系电话格式有误")
    private String tel;

    //脱敏注解，类型为：IDCARD
    @Desensitize(type = DesensitizeType.IDCARD)
    private String idCard;
}
